home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Corrida / GR8Racing.swf / scripts / DefineButton2_93 / BUTTONCONDACTION on(release).as
Encoding:
Text File  |  2005-08-05  |  739 b   |  29 lines

  1. on(release){
  2.    function two(x)
  3.    {
  4.       return (x <= 9 ? "0" : "") + x;
  5.    }
  6.    function three(x)
  7.    {
  8.       var _loc1_ = x;
  9.       return (_loc1_ <= 99 ? "0" : "") + (_loc1_ <= 9 ? "0" : "") + _loc1_;
  10.    }
  11.    function displaytime(ms)
  12.    {
  13.       var _loc2_ = Math.floor(ms / 1000);
  14.       ms %= 1000;
  15.       var _loc1_ = three(ms);
  16.       var _loc3_ = Math.floor(_loc2_ / 60);
  17.       _loc2_ %= 60;
  18.       _loc1_ = two(_loc2_) + ":" + _loc1_;
  19.       var hr = Math.floor(_loc3_ / 60);
  20.       _loc3_ %= 60;
  21.       _loc1_ = two(_loc3_) + ":" + _loc1_;
  22.       return _loc1_;
  23.    }
  24.    _root.totalrace = displaytime(_root.racetimer);
  25.    _root.bestlap = displaytime(_root.bestlaptime);
  26.    stopAllSounds();
  27.    gotoAndPlay(3);
  28. }
  29.